package cn.itcast.nems.studentrecord.dto.change;

import cn.itcast.nems.studentrecord.constant.RefundTypeEnum;
import cn.itcast.nems.studentrecord.service.settlement.SettlementResult;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * 学籍和凭单的关联
 *
 * @author liyong
 * create: 2023-11-22 16:02:06
 **/
@Data
public class StudentRecordJournalDropoutDTO {
    /**
     * 退费类型：退学退费、退学不退费
     */
    private RefundTypeEnum type;

    /**
     * 凭单头ID
     */
    private String journalId;
    
    /**
     * 凭单行ID
     */
    private String journalLineId;

    /**
     * 退费凭单头ID
     */
    private String refundJournalId;

    /**
     * 退费凭单行ID
     */
    private String refundJournalLineId;

    /**
     * 需要退学的学籍ID
     */
    private String studentRecordId;
    
    /**
     * 需要退学的班级ID
     */
    private Integer clazzId;
    
    /**
     * 需要退学的班级名称
     */
    private String clazzName;
    
    /**
     * 退学日期/出班日期
     */
    private LocalDateTime clazzOutDate;

    /**
     * 原班级标准服务天数
     */
    private Integer clazzServiceDays;
    
    /**
     * 原班级结算天数（实际服务天数）
     */
    private Integer clazzSettlementDays;
    
    /**
     * 原班级结算金额
     */
    private Integer clazzSettlementAmount;

    /**
     * 本次退费金额
     */
    private Integer amount;

    public SettlementResult createSettlementResult() {
        SettlementResult result = new SettlementResult();
        result.setServiceDays(this.getClazzServiceDays());
        result.setSettlementDays(this.getClazzSettlementDays());
        result.setSettlementAmount(this.getClazzSettlementAmount());
        return result;
    }
}
